package router

import (
	"api-getaway/handler/api"
	"github.com/gin-gonic/gin"
)

func GoodHandler(good *gin.RouterGroup) {
	{
		good.Use(Cors())
		good.POST("/create", api.Create)
		good.POST("/onload", api.Onload)
		good.POST("/createAttribute", api.CreateAttribute)
		good.POST("/value", api.Value)
		good.POST("/list", api.List)

	}
}

func Cors() gin.HandlerFunc {

	return func(c *gin.Context) {

		c.Header("Access-Control-Allow-Origin", "*")
	}
}
